package com.itheima.ums.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.itheima.mall.pojo.MemberLevel;
import com.itheima.ums.mapper.UmsMemberLevelMapper;
import com.itheima.ums.service.UmsMemberLevelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UmsMemberLevelServiceImpl implements UmsMemberLevelService {

    @Autowired
    private UmsMemberLevelMapper umsMemberLevelMapper;

    //查询所有会员等级
    public List<MemberLevel> list(Long defaultStatus) {
        LambdaQueryWrapper<MemberLevel> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(MemberLevel::getDefaultStatus, defaultStatus);
        return umsMemberLevelMapper.selectList(queryWrapper);
    }
}
